<?
require_once("conn.php");
$barcode = $_REQUEST["barcode"];

$sql = "SELECT * FROM stock WHERE Barcode='".$barcode."';";
$query = mysql_query($sql);
$intNumField = mysql_num_fields($query); 
$resultArray = array();
while($obResult = mysql_fetch_array($query)){
	$arrCol = array();
	for($i=0;$i<$intNumField;$i++){
		$arrCol[mysql_field_name($query,$i)] = $obResult[$i];
	}
	array_push($resultArray,$arrCol);
}
echo json_encode($resultArray);

?>